﻿namespace _02.HumanStudentExercise
{
    using System;
    using System.Linq;

    public class Worker : Human
    {
        public Worker(string firstName, string lastName, decimal weekSalary, double workHoursPerDay)
            : base(firstName, lastName)
        {
            this.WeekSalary = weekSalary;
            this.WorkHoursPerDay = workHoursPerDay;
        }

        public decimal WeekSalary { get; set; }

        public double WorkHoursPerDay { get; set; }

        public override string ToString()
        {
            return string.Format("Worker: {0} {1}, Week Salary: {2}, Work Hours Per Day: {3}, Money Per Hour: {4}",
                   this.FirstName,
                   this.LastName,
                   this.WeekSalary,
                   this.WorkHoursPerDay,
                   this.MoneyPerHour());
        }

        public decimal MoneyPerHour()
        {
            return Math.Round(this.WeekSalary / ((decimal)this.WorkHoursPerDay * 5), 2);
        }
    }
}
